Data on a typical disk storage system is organized into physical sectors, each containing a predetermined number of consecutive bytes. When data is written to a disk drive or read from the disk drive, the quantity of data transferred must be in units of physical sectors, and all data transfers must start and end on a boundary of a physical sector. For example, if a physical sector is comprised of 514 bytes, a data transfer can involve 514 bytes, 1028 bytes, 1542 bytes, etc.
When a processor accesses a disk drive, such as when writing a file, the processor most likely does not need to operate on exactly one physical sector or an integer multiple thereof. Instead, the processor will probably require some quantity of data other than, for example, 514 bytes, 1028 bytes, 1542 bytes, etc.
In the context of transferring data between a processor and a data storage system, the data operated upon by the processor is referred to as a logical sector. As shown above, the boundary of a logical sector does not typically align with the boundary of a physical sector. Consequently, a data transfer often involves the manipulation of more data than is actually to be used by the processor.
Design objectives of a disk storage system usually include maximizing recording density and throughput. Recording density is a ratio of the memory occupied by valid data to the total memory capacity of the disk storage system. Throughput is a measure of the total amount of work processed by a system during a specified period of time.
The following patents are representative of prior art techniques that attempt to maximize recording density and throughput. Generally, they are directed towards systems or methods for either organizing data on a disk drive, or managing the misalignment of logical and physical sector boundaries.
U.S. Pat. No. 5,596,458 to Emo et al., entitled Variable Zone Layout For Information Storage Disk Drive, describes a method and system for improving recording density by measuring the performance characteristics of the individual read/write heads for a disk having a plurality of disk surfaces. Zone boundaries are established for each disk surface based on the performance characteristics, and on the frequency at which data is read from, and written to, a particular zone. The zone boundaries on the surfaces of the disks will not necessarily be vertically aligned. Recording density is improved by reducing the read/write frequency of those heads with a performance characteristic of less than a predetermined level.
U.S. Pat. No. 5,671,439 to Klein et al., entitled Multi-Drive Virtual Mass Storage Device And Method Of Operating Same, describes a virtual mass storage device that is organized into blocks allocated to different physical devices. The physical devices operate in parallel to increase the overall transfer rate of the virtual device.
U.S. Pat. No. 5,765,201 to Manges et al., entitled Changing Page Size In Storage Media Of Computer System, describes an invention that applies to a system in which data is stored in blocks or sectors defined by headers. Tables are used to define memory objects and segments, and to locate virtual memory addresses in physical memory. The headers and tables can be changed without rewriting all the data in the sectors or pages in physical memory. Accordingly, the page size can also be changed to accommodate new system components.
U.S. Pat. No. 5,802,584 to Kool et al., entitled Hardware Alignment In A Headerless Disk Drive Architecture, discloses a system for controlling the transfer of data to and from physical sectors of a disk drive. The system includes a disk controller that decodes an event control word, and a counter that increments as a read/write head passes over a sector on the disk. The counter indicates the position of the read/write head by indicating the data frame over which the head is positioned. An alignment processor scans the control words to locate a control word corresponding to the data frame indicated by the counter. During the scanning, the alignment processor also aligns logical and physical sector counters as indicated by the position of the read/write head. Thereafter, the disk controller uses the aligned values and begins decoding the control words and controlling the data transfer.
U.S. Pat. No. 5,813,025 to Murphy et al., entitled System And Method For Providing Variable Sector-Format Operation To A Disk Access System, describes a system and method for processing I/O requests between a predetermined logical sector format and a variable physical sector format. For a read operation starting in the middle of a physical sector, the data preceding the first logical sector is discarded, and the user requested data is stored in a user buffer. For a write operation to a logical sector located in the middle of a physical sector, the physical sector is read, modified according to the write request to the logical sector, and then written back to the disk as a complete physical sector. A buffer is maintained for holding the data that is read and subsequently modified prior to writing back to the disk.
FIG. 1 illustrates a relationship between logical and physical sectors according to the prior art. A data stream on a disk drive is organized into physical sectors 1-128, of 514 bytes each, which hold logical sectors #1-#32 of 2054 bytes each.
Logical sectors #1-#32 have been written from a processor to the disk drive as a continuous data stream, that is, without gaps or filler between logical sectors. This is a technique used for improving recording density, which is adversely affected by factors such as the presence of invalid or excess data between valid occurrences of data.
Note that four physical sectors total 2056 bytes in length, and that four physical sectors are required to accommodate each logical sector of 2054 bytes. For example, logical sector #1 resides in physical sectors 1-4. Since the 2056-byte length of four physical sectors is two bytes greater than the 2054-byte length of a logical sector, logical sector #1 ends, and logical sector #2 starts, two bytes from the end of physical sector 4. Logical sector #2 then ends four bytes from the end of physical sector 8. That is, logical sector #2 starts at physical sector 4, byte 512, and ends at physical sector 8, byte 510. This two-byte difference accumulates so that logical sector #32 ends 64 bytes, i.e., 32.times.2 bytes, before the end boundary of physical sector 128.
When writing a data stream of 32 logical sectors to the disk drive, a processor must append 64 bytes of padding data to the end of logical sector #32. Upon completion of the write operation, the disk drive issues an interrupt 105 to the processor. After receiving interrupt 105, the processor issues another set of 32 logical sectors to the disk drive.
The subtleties of the relationship between the logical and physical sectors become more apparent when reading data from the disk drive. By way of example, assume that a processor wishes to read logical sector #2. The processor must determine the address of logical sector #2 and recognize that it starts at physical sector 4, byte 512 and ends at physical sector 8, byte 510. Since the disk drive can only transfer data in units of physical sectors, and all data transfers must start and end on a boundary of a physical sector, the disk drive must read all of physical sectors 4-8, inclusive. The processor must then discard excess data. In particular, it must discard data from physical sector 4, bytes 1-511, and physical sector 8, bytes 513 and 514. One of the problems with a system in which logical sectors are not aligned with physical sectors, as shown in FIG. 1, is that the manipulation of excess data decreases the overall throughput of the system.
Another prior art technique for dealing with the misalignment of logical and physical sector boundaries is to pad each of the logical sectors to extend their lengths to that of the physical sectors. Although this operation is relatively straight forward, it is typically implemented in software, and this implementation is accompanied by the consequences discussed below.
FIG. 2 illustrates the effect of padding a logical sector using software. A data stream on a disk drive is organized into physical sectors 1-128, of 514 bytes each, which hold logical sectors #1-#32 of 2054 bytes each. Four physical sectors totaling 2056 bytes in length are required to accommodate each logical sector of 2054 bytes. For example, logical sector #1 resides in physical sectors 1-4. Since the 2056-byte length of physical sectors 1-4 is two bytes greater than the 2054-byte length of a logical sector #1, logical sector #1 ends two bytes from the end of physical sector 4. These 2 bytes are occupied by padding data 205 that has been appended by software to the end of logical sector #1. The start of logical sector #2 aligns with the start of physical sector 5.
The data stream represented in FIG. 2 is not a continuous data stream. During a write operation, a processor prepares 2054 bytes of data for logical sector #1, appends 2 bytes of padding data 205, and then issues the data to the disk drive. Upon completion of the write operation, the disk drive issues an interrupt 210 to the processor. After receiving interrupt 210, the processor issues logical sector #2 with appended data 215 to the disk drive. Upon completion of this write operation, the disk drive issues interrupt 220 to the processor.
Interrupt handlers divert the processor from other tasks and often involve substantial overhead for setting up to service the interrupt. One of the problems with a system in which software appends padding data to the end of logical sectors, as shown in FIG. 2, is that the disk drive interrupts the processor after every write operation.
Accordingly, it is an object of the present invention to provide an improved system, implemented in hardware, that, when writing to a disk drive, appends padding data to a logical sector to align the end boundary of the logical sector with the end boundary of a physical sector.
It is another object of the present invention to provide an improved system, implemented in hardware, that, when reading data from a hard drive, removes padding data from a physical sector to yield a logical sector.
It is yet another object of the present invention to provide an improved system, implemented in hardware, that accommodates logical and physical sectors of variable lengths by appending and extracting padding data of variable lengths.